package com.example.chapter12.design.singleton.demo2;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test {

    public static void main(String[] args) throws InterruptedException {

        ExecutorService service1 = Executors.newFixedThreadPool(1);
        service1.execute(() -> {
            Singleton instance = Singleton.getInstance();
            System.out.println("instance = " + instance);
        });

        ExecutorService service = Executors.newFixedThreadPool(1);
        service.execute(() -> {
            Singleton instance1 = Singleton.getInstance();
            System.out.println("instance1 = " + instance1);
        });

        Thread.sleep(10000L);
    }
}
